import App from './App'
import uviewPlus from '@/uni_modules/uview-plus'

import request from '@/utils/request.js'
import api from '@/utils/api.js'
import { createSSRApp } from 'vue'
// if (typeof window.WeixinJSBridge === "undefined"){
//     if( document.addEventListener ){
//        document.addEventListener('WeixinJSBridgeReady', onBridgeReady, false);
//     }else if (document.attachEvent){
//        document.attachEvent('WeixinJSBridgeReady', onBridgeReady); 
//        document.attachEvent('onWeixinJSBridgeReady', onBridgeReady);
//     }
// }else{
//     onBridgeReady();
// }
 
// function onBridgeReady(){
//     // 这里可以调用微信JS-SDK的相关功能
// }

export function createApp() {
  const app = createSSRApp(App)
  app.config.globalProperties.$req = request
  app.config.globalProperties.$api = api
  app.use(uviewPlus)
  return {
    app
  }
}